﻿using Common.Cache.CacheStorage;
using Common.Cache.Memory;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Cache
{
    public class CacheFactory
    {
        private static ICacheStorage cacheStorage;
        public static ICacheStorage HttpContexCache
        {
            get
            {
                if (cacheStorage == null)
                {
                    cacheStorage = new HttpContextCacheAdapter();
                }
                return cacheStorage;
            }
        }


        private static IMemCache memCache;
        public static IMemCache MemCache
        {
            get
            {
                if (memCache == null)
                {
                    memCache = new MemCache();
                }
                return memCache;
            }
        }
    }
}
